package br.mia.unifor.olio.artifact;

import java.util.ArrayList;
import java.util.List;

import br.mia.unifor.onaga.cloud.artifact.Appliance;
import br.mia.unifor.onaga.cloud.artifact.Instance;

public class OlioAppliance implements Appliance {
	private Instance database;
	private Instance driver;

	private List<Instance> web;

	public Instance getDatabase() {
		return database;
	}

	public void setDatabase(Instance mysql) {
		this.database = mysql;
	}

	public Instance getDriver() {
		return driver;
	}

	public void setDriver(Instance driver) {
		this.driver = driver;
	}

	public List<Instance> getWeb() {
		return web;
	}

	public void setWeb(List<Instance> web) {
		this.web = web;
	}
	
	public boolean setUp() {
		return true;
	}

	public boolean teardown() {
		return true;
	}

	public List<Instance> getInstances() {
		List<Instance> retorno = new ArrayList<Instance>();
		retorno.add(database);
		retorno.add(driver);

		for (Instance instance : web) {
			retorno.add(instance);
		}

		return retorno;
	}
}
